<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html><head>
<title>bitmap</title>
</head><body>
<p>[<a href="mxdoc.htm">mainpage</a>]
[<a href="tags.htm">tags</a>]<br>
<h1><a name="bitmap">module: bitmap</a></h1><p><b>Bitmap functions</b><p>
This module implements bitmap functions for DEGFX.  
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p>Part of the <a href="degfx.htm">degfx</a> library.<ul><li>
<a name="MX_BITMAP"><code>MX_BITMAP</code></a>
<p>
<p><b>A bitmap type  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="MX_BITMAP* mx_bitmap(int x2, int y2)"><code>MX_BITMAP* mx_bitmap(int x2, int y2)</code></a>
<p>
<p><b>Create a bitmap  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<br>
Bitmap is derived from MX_ATOM so it must be destroyed with mx_delete().  
(<a href="../include/degfx/bitmap/bitmap.c">../include/degfx/bitmap/bitmap.c</a>)<p></li>
<li>
<a name="MX_BITMAP* mx_bitmap_tga(const char* filename)"><code>MX_BITMAP* mx_bitmap_tga(const char* filename)</code></a>
<p>
<p><b>Load a bitmap from a TGA file  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<br>
Source taken from the TGA reader from Allegro and extensively modified.  
(<a href="../include/degfx/bitmap/loadtga.c">../include/degfx/bitmap/loadtga.c</a>)<p></li>
<li>
<a name="MX_BITMAP* mx_bitmap_gif(const char* filename)"><code>MX_BITMAP* mx_bitmap_gif(const char* filename)</code></a>
<p>
<p><b>Load a bitmap from a GIF file  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="MX_BITMAP* mx_bitmap_pcx(const char* filename)"><code>MX_BITMAP* mx_bitmap_pcx(const char* filename)</code></a>
<p>
<p><b>Load a bitmap from a PCX file  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<br>
PCX loading source taken from Allegro source and extensively modified.  
(<a href="../include/degfx/bitmap/loadpcx.c">../include/degfx/bitmap/loadpcx.c</a>)<p></li>
<li>
<a name="MX_BITMAP* mx_bitmap_pcx_greyscale(const char* filename)"><code>MX_BITMAP* mx_bitmap_pcx_greyscale(const char* filename)</code></a>
<p>
<p><b>Load a bitmap from a PCX file and convert it to greyscale  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<br>
This function is primarily intended as a helper by font loading.  
(<a href="../include/degfx/bitmap/loadpcx.c">../include/degfx/bitmap/loadpcx.c</a>)<p></li>
<li>
<a name="MX_BITMAP* mx_bitmap_clone(const MX_BITMAP* other)"><code>MX_BITMAP* mx_bitmap_clone(const MX_BITMAP* other)</code></a>
<p>
<p><b>Make a complete copy of a bitmap  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="unsigned mx_bitmap_clip(MX_BITMAP* bitmap, const MX_RECT* newclip)"><code>unsigned mx_bitmap_clip(MX_BITMAP* bitmap, const MX_RECT* newclip)</code></a>
<p>
<p><b>Set a bitmaps clipping area   </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="const MX_RECT* mx_bitmap_clip_get(const MX_BITMAP* bitmap)"><code>const MX_RECT* mx_bitmap_clip_get(const MX_BITMAP* bitmap)</code></a>
<p>
<p><b>Return a bitmaps clipping area  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="void mx_bitmap_offset(MX_BITMAP* bitmap, int x1, int y1)"><code>void mx_bitmap_offset(MX_BITMAP* bitmap, int x1, int y1)</code></a>
<p>
<p><b>Offset a bitmap</b><p>
Subsequent drawing on the bitmap will be offset.  
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="typedef MX_PIXEL* MX_BITMAP_ITER;"><code>typedef MX_PIXEL* MX_BITMAP_ITER;</code></a>
<p>
<p><b>Fast pixel-level iterator for a bitmap  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="MX_BITMAP_ITER mx_bitmap_iter(const MX_BITMAP* bitmap, int x1, int y1)"><code>MX_BITMAP_ITER mx_bitmap_iter(const MX_BITMAP* bitmap, int x1, int y1)</code></a>
<p>
<p><b>Return pixel-level iterator at a given position  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="MX_BITMAP_ITER mx_bitmap_begin(const MX_BITMAP* bitmap)"><code>MX_BITMAP_ITER mx_bitmap_begin(const MX_BITMAP* bitmap)</code></a>
<p>
<p><b>Return pixel-level iterator at the top left position  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="MX_BITMAP_ITER mx_bitmap_end(const MX_BITMAP* bitmap)"><code>MX_BITMAP_ITER mx_bitmap_end(const MX_BITMAP* bitmap)</code></a>
<p>
<p><b>Return pixel-level iterator at the lower right position  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="MX_PIXEL mx_bitmap_getpixel(const MX_BITMAP* bitmap, int x1, int y1)"><code>MX_PIXEL mx_bitmap_getpixel(const MX_BITMAP* bitmap, int x1, int y1)</code></a>
<p>
<p><b>Return pixel a a given position  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<br>
If the coordinates are outside the bitmap area then 0 is returned.  
(<a href="../include/degfx/bitmap/getpixel.c">../include/degfx/bitmap/getpixel.c</a>)<p></li>
<li>
<a name="void mx_bitmap_pixel(MX_BITMAP* bitmap, int x1, int y1, MX_PIXEL color)"><code>void mx_bitmap_pixel(MX_BITMAP* bitmap, int x1, int y1, MX_PIXEL color)</code></a>
<p>
<p><b>Draw a pixel on a bitmap  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<br>
If the specified coordinates are outside the area of the bitmap then
    this function does nothing.  
(<a href="../include/degfx/bitmap/pixel.c">../include/degfx/bitmap/pixel.c</a>)<p></li>
<li>
<a name="void mx_bitmap_vline(MX_BITMAP* bitmap, int x1, int y1, int y2, MX_PIXEL color)"><code>void mx_bitmap_vline(MX_BITMAP* bitmap, int x1, int y1, int y2, MX_PIXEL color)</code></a>
<p>
<p><b>Draw a vertical line on a bitmap  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="void mx_bitmap_hline(MX_BITMAP* bitmap, int x1, int y1, int x2, MX_PIXEL color)"><code>void mx_bitmap_hline(MX_BITMAP* bitmap, int x1, int y1, int x2, MX_PIXEL color)</code></a>
<p>
<p><b>Draw a horizontal line on a bitmap  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="void mx_bitmap_line(MX_BITMAP* bitmap, int x1, int y1, int x2, int y2, MX_PIXEL color)"><code>void mx_bitmap_line(MX_BITMAP* bitmap, int x1, int y1, int x2, int y2, MX_PIXEL color)</code></a>
<p>
<p><b>Draw a line on a bitmap  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="void mx_bitmap_rectfill(MX_BITMAP* bitmap, int x1, int y1, int x2, int y2, MX_PIXEL color)"><code>void mx_bitmap_rectfill(MX_BITMAP* bitmap, int x1, int y1, int x2, int y2, MX_PIXEL color)</code></a>
<p>
<p><b>Draw a filled rectangle on a bitmap  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<br>
The current implementation uses horizontal lines to fill the rectangle.  
(<a href="../include/degfx/bitmap/rectfill.c">../include/degfx/bitmap/rectfill.c</a>)<p></li>
<li>
<a name="void mx_bitmap_clear(MX_BITMAP* bitmap, MX_PIXEL color)"><code>void mx_bitmap_clear(MX_BITMAP* bitmap, MX_PIXEL color)</code></a>
<p>
<p><b>Clear a bitmap to a solid color  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="void mx_bitmap_blit(const MX_BITMAP* src, MX_BITMAP* dest, int sx, int sy, int dx, int dy, int w, int h)"><code>void mx_bitmap_blit(const MX_BITMAP* src, MX_BITMAP* dest, int sx, int sy, int dx, int dy, int w, int h)</code></a>
<p>
<p><b>Blit a bitmap onto another bitmap</b><p>
This function uses the pixel transparency of the source bitmap  
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<br>
If the w or h parameter is set to MXDEFAULT the source bitmap width
        (or height) will be used.  
(<a href="../include/degfx/bitmap/blit.c">../include/degfx/bitmap/blit.c</a>)

<p>The curent implementation requires that the source and destination bitmaps be different.  
(<a href="../include/degfx/bitmap/blit.c">../include/degfx/bitmap/blit.c</a>)

<p>If either of the w or h parameters is less than zer this function does nothing.  
(<a href="../include/degfx/bitmap/blit.c">../include/degfx/bitmap/blit.c</a>)

<p>The transparency is handeled per pixel and the source determines
            the transparency.  
(<a href="../include/degfx/bitmap/blit.c">../include/degfx/bitmap/blit.c</a>)<p></li>
<li>
<a name="void mx_bitmap_blitcopy(const MX_BITMAP* src, MX_BITMAP* dest, int sx, int sy, int dx, int dy, int w, int h)"><code>void mx_bitmap_blitcopy(const MX_BITMAP* src, MX_BITMAP* dest, int sx, int sy, int dx, int dy, int w, int h)</code></a>
<p>
<p><b>Blit a bitmap onto another bitmap</b><p>
This function uses no transparency  
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<br>
The curent implementation requires that the source and destination
        bitmaps be different.  
(<a href="../include/degfx/bitmap/blitcopy.c">../include/degfx/bitmap/blitcopy.c</a>)

<p>If the w or h parameter is set to MXDEFAULT the source bitmap width
        (or height) will be used.  
(<a href="../include/degfx/bitmap/blitcopy.c">../include/degfx/bitmap/blitcopy.c</a>)<p></li>
<li>
<a name="void mx_bitmap_blittrans(const MX_BITMAP* src, MX_BITMAP* dest, int sx, int sy, int dx, int dy, int w, int h, unsigned long trans)"><code>void mx_bitmap_blittrans(const MX_BITMAP* src, MX_BITMAP* dest, int sx, int sy, int dx, int dy, int w, int h, unsigned long trans)</code></a>
<p>
<p><b>Blit a bitmap onto another bitmap</b><p>
This function uses the a single transparency level  
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<br>
The w and h parameters may be MXDEFAULT and the width of the source
    bitmap will be used.  
(<a href="../include/degfx/bitmap/trans.c">../include/degfx/bitmap/trans.c</a>)

<p>The current implementation requires that the source and destination
        bitmaps not refer to the same bitmap.  
(<a href="../include/degfx/bitmap/trans.c">../include/degfx/bitmap/trans.c</a>)<p></li>
<li>
<a name="void mx_bitmap_blitstretch(const MX_BITMAP* src, MX_BITMAP* dest, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh)"><code>void mx_bitmap_blitstretch(const MX_BITMAP* src, MX_BITMAP* dest, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh)</code></a>
<p>
<p><b>Stretch-blit a bitmap onto another bitmap</b><p>
This function uses the pixel transparency of the source bitmap  
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<br>
The default source poisition is 0,0.  
(<a href="../include/degfx/bitmap/stretch.c">../include/degfx/bitmap/stretch.c</a>)

<p>The default source height and width is the height and width of the source bitmap.  
(<a href="../include/degfx/bitmap/stretch.c">../include/degfx/bitmap/stretch.c</a>)

<p>The default destination poisition is 0,0.  
(<a href="../include/degfx/bitmap/stretch.c">../include/degfx/bitmap/stretch.c</a>)

<p>The default destinantion height and width is the height and width of the destination bitmap.  
(<a href="../include/degfx/bitmap/stretch.c">../include/degfx/bitmap/stretch.c</a>)
<p>Bitmap stretch algorithm is very simple and could definetly be improved.  
(<a href="../include/degfx/bitmap/stretch.c">../include/degfx/bitmap/stretch.c</a>)<p></li>
<li>
<a name="void mx_bitmap_box(MX_BITMAP* bitmap, int x1, int y1, int x2, int y2, int width, MX_PIXEL light, MX_PIXEL dark)"><code>void mx_bitmap_box(MX_BITMAP* bitmap, int x1, int y1, int x2, int y2, int width, MX_PIXEL light, MX_PIXEL dark)</code></a>
<p>
<p><b>Draw a box on a bitmap  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="void mx_bitmap_frame(MX_BITMAP* bitmap, int x1, int y1, int x2, int y2, int width, MX_PIXEL light, MX_PIXEL dark, MX_PIXEL fill)"><code>void mx_bitmap_frame(MX_BITMAP* bitmap, int x1, int y1, int x2, int y2, int width, MX_PIXEL light, MX_PIXEL dark, MX_PIXEL fill)</code></a>
<p>
<p><b>Draw a frame on a bitmap  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="void mx_bitmap_decorate(const MX_BITMAP* src, MX_BITMAP* dest, int x, int y, int x1, int y1, int x2, int y2)"><code>void mx_bitmap_decorate(const MX_BITMAP* src, MX_BITMAP* dest, int x, int y, int x1, int y1, int x2, int y2)</code></a>
<p>
<p><b>Blitting function for drawing gui objects  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="unsigned mx_bitmap_collision(const MX_BITMAP* src, const MX_BITMAP* dest, int sx, int sy, int dx, int dy, unsigned int thresh)"><code>unsigned mx_bitmap_collision(const MX_BITMAP* src, const MX_BITMAP* dest, int sx, int sy, int dx, int dy, unsigned int thresh)</code></a>
<p>
<p><b>Check if two bitmaps overlap on any pixels</b><p>
Pixel level transparency is taken into account  
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_iter(x,y)"><code>#define mx_iter(x,y)</code></a>
<p>
<p><b>Get an iterator to a given position on the screen  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_getpixel(x,y)"><code>#define mx_getpixel(x,y)</code></a>
<p>
<p><b>Return the pixel at a given position on the screen  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_pixel(x,y,c)"><code>#define mx_pixel(x,y,c)</code></a>
<p>
<p><b>Draw a pixel on the screen  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_vline(x,y1,y2,c)"><code>#define mx_vline(x,y1,y2,c)</code></a>
<p>
<p><b>Draw a vertical line on the screen  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_hline(x1,y,x2,c)"><code>#define mx_hline(x1,y,x2,c)</code></a>
<p>
<p><b>Draw a horizontal line on the screen  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_line(x1,y1,x2,y2,c)"><code>#define mx_line(x1,y1,x2,y2,c)</code></a>
<p>
<p><b>Draw a line on the screen  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_rectfill(x1,y1,x2,y2,c)"><code>#define mx_rectfill(x1,y1,x2,y2,c)</code></a>
<p>
<p><b>Draw a filled rectangle on the screen  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_clear(c)"><code>#define mx_clear(c)</code></a>
<p>
<p><b>Clear the screen to a solid color  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_blit(s,sx,sy,dx,dy,w,h)"><code>#define mx_blit(s,sx,sy,dx,dy,w,h)</code></a>
<p>
<p><b>Blit a bitmap onto the screen</b><p>
This function uses the pixel transparency of the source bitmap  
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_blitcopy(s,sx,sy,dx,dy,w,h)"><code>#define mx_blitcopy(s,sx,sy,dx,dy,w,h)</code></a>
<p>
<p><b>Blit a bitmap onto the screen</b><p>
This function uses no transparency  
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_blittrans(s,sx,sy,dx,dy,w,h,t)"><code>#define mx_blittrans(s,sx,sy,dx,dy,w,h,t)</code></a>
<p>
<p><b>Blit a bitmap onto the screen</b><p>
This function uses the a single transparency level  
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_blitstretch(s,sx,sy,sw,sh,dx,dy,dw,dh)"><code>#define mx_blitstretch(s,sx,sy,sw,sh,dx,dy,dw,dh)</code></a>
<p>
<p><b>Stretch-blit a bitmap onto the screen</b><p>
This function uses the pixel transparency of the source bitmap  
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_box(x1,y1,x2,y2,w,l,d)"><code>#define mx_box(x1,y1,x2,y2,w,l,d)</code></a>
<p>
<p><b>Draw a box on the screen  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_frame(x1,y1,x2,y2,w,l,d,f)"><code>#define mx_frame(x1,y1,x2,y2,w,l,d,f)</code></a>
<p>
<p><b>Draw a frame on the screen  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="define mx_decorate(s,x,y,x1,y1,x2,y2)"><code>#define mx_decorate(s,x,y,x1,y1,x2,y2)</code></a>
<p>
<p><b>Blitting function for drawing gui objects on the screen  </b><p>
(<a href="../include/degfx/bitmap.h">../include/degfx/bitmap.h</a>)<p></li>
<li>
<a name="bitmap.h" unsigned mx_bitmap_collision(const MX_BITMAP* src, const MX_BITMAP* dest, int sx, int sy, int dx, int dy, unsigned int thresh)"><code>bitmap.h" unsigned mx_bitmap_collision(const MX_BITMAP* src, const MX_BITMAP* dest, int sx, int sy, int dx, int dy, unsigned int thresh)</code></a>
<p>
<p>Collision is defined by both bitmaps having a transparency
                less than the threshold on overlapping pixels.  
(<a href="../include/degfx/bitmap/collisio.c">../include/degfx/bitmap/collisio.c</a>)<p></li>
<li>
<a name="bitmap.h" void mx_bitmap_decorate(const MX_BITMAP* src, MX_BITMAP* dest, int x, int y, int x1, int y1, int x2, int y2)"><code>bitmap.h" void mx_bitmap_decorate(const MX_BITMAP* src, MX_BITMAP* dest, int x, int y, int x1, int y1, int x2, int y2)</code></a>
<p>
<p>The corners of the source bitmap are copied as normal.  
(<a href="../include/degfx/bitmap/decorate.c">../include/degfx/bitmap/decorate.c</a>)<p></li>
<li>
<a name="bitmap.h" MX_BITMAP_ITER mx_bitmap_iter(const MX_BITMAP* bitmap, int x1, int y1)"><code>bitmap.h" MX_BITMAP_ITER mx_bitmap_iter(const MX_BITMAP* bitmap, int x1, int y1)</code></a>
<p>
<p>If the pixel position is outside the area of the bitmap then 0 is
        returned.  
(<a href="../include/degfx/bitmap/iter.c">../include/degfx/bitmap/iter.c</a>)<p></li>
</ul><p>Generated by <a href="http://www.deleveld.dds.nl/mxdoc/index.htm">MXDOC</a> 2.2 on Sun Feb  4 15:16:26 2007


</body></html>
